package com.yan.demo.loopdemo;

public class Test8 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 2; i <= 100; i++) {
            boolean flag = true;
            for (int j = 2; j < i-1; j++) {
                if(i % j == 0){
                    flag = false;
                    break;
                }
            }
            if (flag == true){
                System.out.print(i + " ");
                count++;
            }
        }
        System.out.println("count = " + count);
    }
}
